package com.prompt;

import android.content.BroadcastReceiver; 
import android.content.Context; 
import android.content.Intent; 
import android.util.Log;
 
public class BootCompletedReceiver extends BroadcastReceiver { 
  @Override 
  public void onReceive(Context context, Intent intent) { 
    if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) 
    { 
    	 Log.d("tag", "BootCompletedReceiver BroadcastReceiver");
      Intent mainIntent = new Intent(context, MainActivity.class); 
      mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  //注意，必须添加这个标记，否则启动会失败 
//      context.startActivity(newIntent);  
      context.startService(mainIntent);      
      
//      Tester tester = new Tester(context);
//      tester.showNotice();
    }       
  } 
}
